package com.tencent.mm.opensdk.diffdev.a;

import android.util.Log;

import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.util.EntityUtils;

public final class e {
    public static byte[] a(String arg5, int arg6) {
        byte[] v0 = null;
        if (arg5 != null && arg5.length() != 0) {
            DefaultHttpClient v1 = new DefaultHttpClient();
            HttpGet v2 = new HttpGet(arg5);
            try {
                if (arg6 >= 0) {
                    HttpConnectionParams.setSoTimeout(((HttpClient) v1).getParams(), arg6);
                }

                HttpResponse v1_4 = ((HttpClient) v1).execute(((HttpUriRequest) v2));
                if (v1_4.getStatusLine().getStatusCode() != 200) {
                    Log.e("MicroMsg.SDK.NetUtil", "httpGet fail, status code = " + v1_4.getStatusLine().getStatusCode());
                    return v0;
                }

                v0 = EntityUtils.toByteArray(v1_4.getEntity());
                return v0;
            } catch (IncompatibleClassChangeError v1_2) {
                Log.e("MicroMsg.SDK.NetUtil", "httpGet, IncompatibleClassChangeError ex = " + v1_2.getMessage());
            } catch (Exception v1_3) {
                Log.e("MicroMsg.SDK.NetUtil", "httpGet, Exception ex = " + v1_3.getMessage());
            } catch (Throwable v1_1) {
                Log.e("MicroMsg.SDK.NetUtil", "httpGet, Throwable ex = " + v1_1.getMessage());
            }
            return v0;

        }

        Log.e("MicroMsg.SDK.NetUtil", "httpGet, url is null");
        return v0;
    }
}

